//
//  SCAN ITEM.m
//  GUIinterface
//
//  Created by Anurak on 1/29/55 BE.
//  Copyright (c) 2555 __MyCompanyName__. All rights reserved.
//

#import "SCAN_ITEM.h"
#import "ScannedImgAppDataObject.h"
#import "AppDelegateProtocol.h"

@implementation SCAN_ITEM

@synthesize resultImage,resultText;

#pragma mark -
#pragma mark instance methods

- (ScannedImgAppDataObject*) theAppDataObject;
{
	id<AppDelegateProtocol> theDelegate = (id<AppDelegateProtocol>) [UIApplication sharedApplication].delegate;
	ScannedImgAppDataObject* theDataObject;
	theDataObject = (ScannedImgAppDataObject*) theDelegate.theAppDataObject;
	return theDataObject;
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}



- (void)viewWillAppear:(BOOL)animated
{
	ScannedImgAppDataObject* theDataObject = [self theAppDataObject];
	resultText.text = theDataObject.itemID;
	resultImage.image = theDataObject.qrCodeImg;
}


#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setResultImage:nil];
    [self setResultText:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    //return (interfaceOrientation == UIInterfaceOrientationPortrait);
    return (YES);
}

@end
